import useKeyUp from "../hooks/useKeyUp";
import { FC } from "react";

interface PopoverOverlayProps {
  closeOnEscape: boolean;
  onClose(): void;
}

const PopoverOverlay: FC<PopoverOverlayProps> = ({
  closeOnEscape,
  onClose,
}) => {
  useKeyUp(27, () => closeOnEscape && onClose());

  return <div className="rpv-core__popover-overlay" />;
};

export default PopoverOverlay;
